import Vue from 'vue'
import Vuex from 'vuex'
// import app from './modules/app';
import { createPersistedState, createSharedMutations } from "vuex-electron"

Vue.use(Vuex)

export default new Vuex.Store({
     state: {
        version: '1.0',
        appName: 'vue + iview'
    },
    getters: {
        ["app/_getVersion"](state) {
            return state.version ;
        },
        ["app/_getAppName"](state){
            return state.appName;
        } 
    },
    mutations: {
        ['app/logout'](state, menus) { 
            //退出登陆
        },
        ['app/initUserInfo'](state, userInfo) {
             //初始化用户信息
        },
        ['app/initDocument'](state, userInfo) {
            document.title = state.appName
            console.log('app/initDocument');
        }
    },
    actions: { 
        ["app/initApp"]({state, dispatch, commit}) {
            //初始化应用信息
            // commit("app/initDocument") 
            console.log("-----11111");
        },

    },
    plugins: [createPersistedState(), createSharedMutations()],
})

